package com.imooc.service;

import com.imooc.pojo.UserAddress;
import com.imooc.pojo.Users;
import com.imooc.pojo.bo.AddressBO;
import com.imooc.pojo.bo.UserBo;
import com.imooc.utils.CommonJsonResult;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author: 逸尘风清
 * @Date: 2021/5/6
 * @Time: 22:08
 * 描述：
 */
public interface AddressService {
    public List<UserAddress> getAddress(String userId);

    @Transactional(propagation = Propagation.REQUIRED)
    UserAddress addOrUpdateAddress(AddressBO addressBO);

    @Transactional(propagation = Propagation.REQUIRED)
    CommonJsonResult delAddress(String userId, String addressId);

    @Transactional(propagation = Propagation.REQUIRED)
    CommonJsonResult setDefaultAddress(String userId, String addressId);

    @Transactional(propagation = Propagation.SUPPORTS)
    UserAddress getSingleAddressByUserIdAndAddressId(String userId, String addressId);
}
